package com.maidou.qiantai.common.utils;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Author zzww
 * @Date 2024/3/20 12:58
 */
public class StringAttrValueUtils
{

    public static List<String> SplitAttrValue(String value){
        List<String> list = new ArrayList<>();
        if (value==null){
            return list;
        }else{
            try {
                list = Arrays.asList(value.split(","));
                if (list.size()==1){
                    String[] split = value.split("、");
                    ArrayList<String> stringArrayList = new ArrayList<>();
                    for (String s:split
                    ) {
                        stringArrayList.add(s);

                    }
                    list = stringArrayList;
                    if (list.size()==1){
                        return list;
                    }
                }
            }catch (Exception e){
                list = Arrays.asList(value.split("、"));
            }
            return list;
        }
    }
    public static String JoinString(List<String> list){
        return String.join(",", list);
    }
}
